﻿Imports System.Data.SqlClient
Partial Class forgotten_password_1
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load


    End Sub

    Protected Sub txtRetypePassword_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtRetypePassword.TextChanged

    End Sub

    Protected Sub txtUserName_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txttypePassword.TextChanged

    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            Dim cn As New SqlConnection(ConfigurationSettings.AppSettings("conn"))
            Dim cmd As New SqlCommand("update users set password='" + txttypePassword.Text + "' where username='" + Session("forgetusername").ToString.ToLower + "'", cn)
            cn.Open()
            cmd.ExecuteNonQuery()
            cn.Close()
            Label1.Text = "Your password has been changed."
            Session("username") = Session("forgetusername").ToString.ToLower

        Catch ex As Exception
            MsgBox(ex.Message)

        End Try

    End Sub
End Class
